package com.design.yjx.singleton;

/**
 * @author yuanjianxin
 * @date 2017/8/3 18:22
 * 单例模式：加入synchronized，同步线程，避免多线程造成的安全问题
 */
public class Emp {
    private static Emp emp;

    private Emp(){
    }

    public static synchronized Emp getInstance(){
        if (emp == null){
            emp = new Emp();
        }
        return emp;
    }



}
